✨ BCA JUL24 Batch ✨

Join Our WhatsApp Group

Anukasif Pic

4.1 - Arrays - MCQs

Interactive MCQs Quiz

Test your knowledge with these questions

1. What is the primary purpose of an array in programming?

2. What is the starting index for an array in C?

3. How can an array be declared in C?

4. What type of values can arrays hold?

5. Which of the following is NOT an operation that can be performed on an array?

6. How do you access the first element of an array named "arr"?

7. What will be the output of the following code snippet?
int arr[3] = {1, 2, 3}; printf("%d", arr[3]);

8. In the declaration int arr[5] = {1, 2, 3}; what happens to the remaining two elements?

9. Which of the following statements is true about arrays in C?

10. What does the process of array subscripting involve?

11. What is the time complexity for retrieving any array element?

12. How many dimensions can an array have in C?

13. What is the syntax to declare a one-dimensional array of integers?

14. Which of the following is a disadvantage of using arrays?

15. How can an array be initialized with a loop?

16. In the array declaration int arr[10]; how many elements can it hold?

17. What is the output of the following code? int arr[5] = {0, 1, 2, 3, 4}; printf("%d", arr[2]);

18. Which operation is used to combine two different arrays?

19. What is the purpose of the loop in the following code? for (i = 0; i < 5; i++) { arr[i] = i + 1; }

20. What will be the output of the following code?
 
         int arr[5] = {1, 2, 3, 4, 5}; 
         arr[2] = 10; printf("%d", arr[2]);

21. How are multidimensional arrays stored in memory?

22. What is a 2-dimensional array commonly referred to as?

23. Which of the following is a valid 2-dimensional array declaration?

24. In C, how are elements in 2D arrays inserted?

25. Which function is used to read elements into a 2D array?

26. How can an element in a 2D array be updated?

27. How is the row number of an element in a 2D array removed?

28. What is the result of multiplying two matrices?

29. How is matrix multiplication performed?

30. How are rows and columns specified for a 2D array in C?

31. What is the syntax to declare a 2D array in C?

32. What is the dimension of an array defined as int arr[4][3]?

33. Which one of the following is a correct syntax for declaring a 2D array?

34. What will be the result of int arr[2][3] = {1, 2, 3, 4, 5, 6};?

35. What is a matrix in a 2D array referred to when rows and columns are equal?

36. How does matrix multiplication handle elements of the resulting matrix?

37. What does the second index of a 2D array represent?

38. When dynamically allocating a 2D array, what does malloc() return?

39. What is the output of the following code: int arr[2][2] = {{1, 2}, {3, 4}}; printf("%d", arr[1][1]);?

40. What is the correct way to access the first row and second column of a 2D array named 'matrix'?